﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Multiprocessing.Core.Mathematics.Matrices
{
    internal static class MatrixExtenstions
    {
        internal static void RandomFill(this IMatrix matrix)
        {
            if (ReferenceEquals(matrix, null))
            {
                throw new ArgumentNullException("matrix");
            }
            Random rand = new Random();
            for (int row = 0; row < matrix.RowCount; row++ )
            {
                for (int column = 0; column < matrix.ColumnCount; ++column)
                {
                    matrix[row, column] = rand.NextDouble();
                }
            }
        }
    }
}
